<template>
  <page-header-wrapper>
    <template #content>
      <div class="page-header-content">
        <div class="avatar">
          <a-avatar size="large" :src="currentUser.avatar" />
        </div>
        <div class="content">
          <div class="content-title">
            {{ timeFix }}，{{ user.name }}<span class="welcome-text">，{{ welcome }}</span>
          </div>
          <div>前端工程师</div>
        </div>
      </div>
    </template>
    <template #extraContent>
      <div class="extra-content">
        <div class="stat-item">
          <a-statistic title="项目数" :value="56" />
        </div>
        <div class="stat-item">
          <a-statistic title="团队内排名" :value="8" suffix="/ 24" />
        </div>
        <div class="stat-item">
          <a-statistic title="项目访问" :value="2223" />
        </div>
      </div>
    </template>

    <div>aaaaa</div>
  </page-header-wrapper>
</template>

<script>
import { timeFix } from '@/utils/util';
import { mapState } from 'vuex';
import { PageHeaderWrapper } from '@ant-design-vue/pro-layout';

export default {
  name: 'Workplace',
  components: {
    PageHeaderWrapper
  },
  data() {
    return {
      timeFix: timeFix(),
      avatar: '',
      user: {},
      loading: true,
      radarLoading: true
    };
  },
  computed: {
    ...mapState({
      nickname: (state) => state.user.nickname,
      welcome: (state) => state.user.welcome
    }),
    currentUser() {
      return {
        name: 'Serati Ma',
        avatar: 'https://gw.alipayobjects.com/zos/antfincdn/XAosXuNZyF/BiazfanxmamNRoxxVxka.png'
      };
    },
    userInfo() {
      return this.$store.getters.userInfo;
    }
  },
  created() {
    this.user = this.userInfo;
    this.avatar = this.userInfo.avatar;
  },
  mounted() {},
  methods: {}
};
</script>

<style lang="less" scoped>
@import './Workplace.less';
</style>
